#!/bin/bash

input="$1"
if [ ! -z "$2" ];then
	output="$2.mp3"
else
	output="$1.mp3"
fi

if [ ! -d ~/Music/talk ];then
	mkdir ~/Music/talk
fi

cd ~/Music/talk
edge-tts -v zh-CN-XiaoxiaoNeural -t "$input" --write-media "$output" && mpg123 $output &> /dev/null
